package com.pkk.penguin.frame.know.java.driven.bean;

import java.io.Serializable;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @description: java的依赖注入配置
 * @author: peikunkun
 * @create: 2020-07-17 11:46
 **/
@Data
@Slf4j
public class JavaBean implements Serializable {

  private static final long serialVersionUID = -5899102847467243875L;

  private Long id;

  private String name;

  public JavaBean() {
    log.info(this.getClass().getSimpleName() + "-" + this.getId() + "无参初始化");
  }

  public JavaBean(Long id, String name) {
    log.info(this.getClass().getSimpleName() + "-" + this.getId() + "有参初始化");
    this.id = id;
    this.name = name;
  }

  /**
   * @Description: bean初始化的方法
   * @return: void
   * @Author: peikunkun
   * @Date: 2020/7/17 0017 上午 11:37
   */
  public void init() {
    log.info(this.getClass().getSimpleName() + "-" + this.getId() + "-进行初始化操作");
  }

  /**
   * @Description: bean销毁的方法
   * @return: void
   * @Author: peikunkun
   * @Date: 2020/7/17 0017 上午 11:37
   */
  public void destory() {
    log.info(this.getClass().getSimpleName() + "-" + this.getId() + "-进行销毁操作");
  }
}
